<template>
  <div class="pages">
    <el-card shadow="always">
      <!-- 搜索 -->
      <el-row>
        <el-col :span="24" class="head">
          <el-button type="primary">添加页面</el-button>
          <div class="screening">
            <el-input placeholder="请输入关键字"></el-input>
            <el-button>筛选</el-button>
          </div>
        </el-col>
      </el-row>
      <!-- 表格 -->
      <el-row class="form">
        <el-col :span="24">
          <el-table
            :data="pagesList"
            :model="pagesList"
            border
            style="width: 100%"
          >
            <el-table-column prop="title" label="标题"> </el-table-column>
            <el-table-column v-html="pagesList.content" label="内容">
              <!-- <template v-slot="{ row }" v-html="row.content">
                {{row.content}}
              </template> -->
              <!-- {{pagesList.content}} -->
            </el-table-column>
            <el-table-column label="操作">
              <el-button type="text" size="small">查看</el-button>
              <el-button type="text" size="small">编辑</el-button>
            </el-table-column>
          </el-table>
        </el-col>
      </el-row>
    </el-card>
  </div>
</template>

<script>
import { getPageList } from "@/api/pages";
export default {
  data() {
    return {
      pagesList: [],
      limitList: {
        _limit: 2,
        _start: 0,
      },
      list: '',
    };
  },
  created() {
    this.getPageListFn();
  },
  methods: {
    // 渲染页面
    async getPageListFn() {
      let res = await getPageList(this.limitList);
      console.log(res.data);
      this.pagesList = res.data;
      this.list = res.pagesList.content
      console.log(this.list);
    },
  },
};
</script>

<style lang="scss" scoped>
.pages {
  padding: 20px 20px 0 20px;

  .head {
    display: flex;
    justify-content: space-between;

    .screening {
      display: flex;

      .el-input {
        width: 500px;
      }
    }
  }

  .form {
    padding-top: 15px;
    margin-top: 15px;
    border-top: 1px solid #e2dddd;
  }
}
</style>